#include<bits/stdc++.h>
using namespace std;
int n,cnt,a[1000000];
int main()
{
	freopen("fruit.in","r",stdin);
	freopen("fruit.out","w",stdout);
	scanf("%d",&n);
	for(int i=1;i<=n;i++)scanf("%d",a+i);
	cnt=n;
	for(int i=1;i<=n;i++)a[i]++;
	while(cnt){
		int tmp=0;
		for(int i=1;i<=n;i++)
			if(a[i]){
				if(a[i]!=tmp)printf("%d ",i),tmp=a[i],a[i]=0,cnt--;
				else tmp=a[i];
			}
		printf("\n");
	}
	return 0;
}
